<?php
class Pageley_Controller_Dynamic extends Pageley_Controller_TransactionalForm {
	
    private $parameters;
    
    public function __construct($views, $commandClassName, $unitOfWork, $parameters = null) {
        parent::__construct($views, $commandClassName, $unitOfWork);
        $this->parameters = $parameters;
    }
    
    protected function populateCommand($command, $parameters) {
        foreach($parameters as $key => $value) {
            $command->set($key, $value);
        }
        if($this->parameters !== null) {
            foreach($this->parameters as $key => $value) {
                $command->set($key, $value);
            }
        }
    }
}